package com.simba.system.controller;


import com.simba.response.Result;
import com.simba.system.entity.User;
import com.simba.system.service.UserService;
import io.swagger.annotations.ApiOperation;
import lombok.val;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户信息表 前端控制器
 * </p>
 *
 * @author 陈俊 1002471284@qq.com
 * @since 2021-03-24
 */
@RestController
@RequestMapping("/system/user")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/getUser")
    @ApiOperation(value = "查询单个用户信息")
    public Result getUser(String username) {
        User user = userService.getUserByUsername(username);
        return Result.success().data("data", user);
    }
}

